


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>Building Akka &mdash; Akka Documentation</title>
    
    <link rel="stylesheet" href="../_static/style.css" type="text/css" />
    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
    <link rel="stylesheet" href="../_static/prettify.css" type="text/css" />
    <link rel="stylesheet" href="../_static/base.css" type="text/css" />
    <link rel="stylesheet" href="../_static/docs.css" type="text/css" />
    <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Exo:300,400,600,700" type="text/css" />
    
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '../',
        VERSION:     '2.0.1',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="../_static/jquery.js"></script>
    <script type="text/javascript" src="../_static/underscore.js"></script>
    <script type="text/javascript" src="../_static/doctools.js"></script>
    <script type="text/javascript" src="../_static/toc.js"></script>
    <script type="text/javascript" src="../_static/prettify.js"></script>
    <script type="text/javascript" src="../_static/highlightCode.js"></script>
    <script type="text/javascript" src="../_static/effects.core.js"></script>
    <script type="text/javascript" src="../_static/effects.highlight.js"></script>
    <script type="text/javascript" src="../_static/scrollTo.js"></script>
    <script type="text/javascript" src="../_static/contentsFix.js"></script>
    <link rel="shortcut icon" href="../_static/favicon.ico"/>
    <link rel="top" title="Akka Documentation" href="../index.html" />
    <link rel="up" title="Information for Developers" href="index.html" />
    <link rel="next" title="Multi-JVM Testing" href="multi-jvm-testing.html" />
    <link rel="prev" title="Information for Developers" href="index.html" /> 
  </head>
  <body>
  <div class="navbar">
    <div class="navbar-inner">
      <div class="container">
        <div class="navbar-logo">
          <a href="http://akka.io"><img src="../_static/logo-small.png" /></a>
        </div>    
        <ul class="nav">
          <li><a href="http://akka.io/docs">Documentation</a></li>
          <li><a href="http://akka.io/downloads">Download</a></li>
          <li><a href="http://groups.google.com/group/akka-user">Mailing List</a></li>
          <li><a href="http://github.com/akka/akka">Code</a></li>           
          <li><a href="http://typesafe.com/products/typesafe-subscription">Commerical Support</a></li>
        </ul>
      </div>
    </div>
  </div>
  <div class="main">
    <div class="container">
      <div class="page-title">Building Akka</div><div class="pdf-link"><a href="http://akka.io/docs/akka/2.0.1/Akka.pdf"><img src="../_static/pdf-icon.png" style="height: 40px;" /></a></div></div>
    <div class="main-container">
      <div class="container">
        <div class="row">
          <div class="span12">
            <ul class="breadcrumb">           
              <li>
                 <span class="divider">|</span> <a href="multi-jvm-testing.html">Multi-JVM Testing</a> <span class="divider">»</span>
              </li>
              <li>
                <a href="../index.html">Contents</a>
              </li>
              <li>
                <span class="divider">«</span> <a href="index.html">Information for Developers</a> <span class="divider">|</span>
              </li>
              <li>
                Version 2.0.1
              </li>
            </ul>         
          </div>
        </div>
        <div class="row">
          <div class="span9">
            
  <div class="section" id="building-akka">
<span id="id1"></span><h1>Building Akka</h1>
<p>This page describes how to build and run Akka from the latest source code.</p>
<div class="section" id="get-the-source-code">
<h2>Get the source code</h2>
<p>Akka uses <a class="reference external" href="http://git-scm.com">Git</a> and is hosted at <a class="reference external" href="http://github.com">Github</a>.</p>
<p>You first need Git installed on your machine. You can then clone the source
repository from <a class="reference external" href="http://github.com/akka/akka">http://github.com/akka/akka</a>.</p>
<p>For example:</p>
<div class="highlight-none"><div class="highlight"><pre>git clone git://github.com/akka/akka.git
</pre></div>
</div>
<p>If you have already cloned the repository previously then you can update the
code with <tt class="docutils literal"><span class="pre">git</span> <span class="pre">pull</span></tt>:</p>
<div class="highlight-none"><div class="highlight"><pre>git pull origin master
</pre></div>
</div>
</div>
<div class="section" id="sbt-simple-build-tool">
<h2>sbt - Simple Build Tool</h2>
<p>Akka is using the excellent <a class="reference external" href="https://github.com/harrah/xsbt">sbt</a> build system. So the first thing you have to
do is to download and install sbt. You can read more about how to do that in the
<a class="reference external" href="https://github.com/harrah/xsbt/wiki/Setup">sbt setup</a> documentation.</p>
<p>The sbt commands that you&#8217;ll need to build Akka are all included below. If you
want to find out more about sbt and using it for your own projects do read the
<a class="reference external" href="https://github.com/harrah/xsbt/wiki">sbt documentation</a>.</p>
<p>The Akka sbt build file is <tt class="docutils literal"><span class="pre">project/AkkaBuild.scala</span></tt>.</p>
</div>
<div class="section" id="id2">
<h2>Building Akka</h2>
<p>First make sure that you are in the akka code directory:</p>
<div class="highlight-none"><div class="highlight"><pre>cd akka
</pre></div>
</div>
<div class="section" id="building">
<h3>Building</h3>
<p>To compile all the Akka core modules use the <tt class="docutils literal"><span class="pre">compile</span></tt> command:</p>
<div class="highlight-none"><div class="highlight"><pre>sbt compile
</pre></div>
</div>
<p>You can run all tests with the <tt class="docutils literal"><span class="pre">test</span></tt> command:</p>
<div class="highlight-none"><div class="highlight"><pre>sbt test
</pre></div>
</div>
<p>If compiling and testing are successful then you have everything working for the
latest Akka development version.</p>
</div>
<div class="section" id="parallel-execution">
<h3>Parallel Execution</h3>
<p>By default the tests are executed sequentially. They can be executed in parallel to reduce build times,
if hardware can handle the increased memory and cpu usage. Add the following system property to sbt
launch script to activate parallel execution:</p>
<div class="highlight-none"><div class="highlight"><pre>-Dakka.parallelExecution=true
</pre></div>
</div>
</div>
<div class="section" id="publish-to-local-ivy-repository">
<h3>Publish to local Ivy repository</h3>
<p>If you want to deploy the artifacts to your local Ivy repository (for example,
to use from an sbt project) use the <tt class="docutils literal"><span class="pre">publish-local</span></tt> command:</p>
<div class="highlight-none"><div class="highlight"><pre>sbt publish-local
</pre></div>
</div>
</div>
<div class="section" id="sbt-interactive-mode">
<h3>sbt interactive mode</h3>
<p>Note that in the examples above we are calling <tt class="docutils literal"><span class="pre">sbt</span> <span class="pre">compile</span></tt> and <tt class="docutils literal"><span class="pre">sbt</span> <span class="pre">test</span></tt>
and so on, but sbt also has an interactive mode. If you just run <tt class="docutils literal"><span class="pre">sbt</span></tt> you
enter the interactive sbt prompt and can enter the commands directly. This saves
starting up a new JVM instance for each command and can be much faster and more
convenient.</p>
<p>For example, building Akka as above is more commonly done like this:</p>
<div class="highlight-none"><div class="highlight"><pre>% sbt
[info] Set current project to default (in build file:/.../akka/project/plugins/)
[info] Set current project to akka (in build file:/.../akka/)
&gt; compile
...
&gt; test
...
</pre></div>
</div>
</div>
<div class="section" id="sbt-batch-mode">
<h3>sbt batch mode</h3>
<p>It&#8217;s also possible to combine commands in a single call. For example, testing,
and publishing Akka to the local Ivy repository can be done with:</p>
<div class="highlight-none"><div class="highlight"><pre>sbt test publish-local
</pre></div>
</div>
</div>
</div>
<div class="section" id="dependencies">
<span id="id3"></span><h2>Dependencies</h2>
<p>You can look at the Ivy dependency resolution information that is created on
<tt class="docutils literal"><span class="pre">sbt</span> <span class="pre">update</span></tt> and found in <tt class="docutils literal"><span class="pre">~/.ivy2/cache</span></tt>. For example, the
<tt class="docutils literal"><span class="pre">~/.ivy2/cache/com.typesafe.akka-akka-remote-compile.xml</span></tt> file contains
the resolution information for the akka-remote module compile dependencies. If
you open this file in a web browser you will get an easy to navigate view of
dependencies.</p>
</div>
</div>


          </div>
          <div class="span3"><p class="contents-title">Contents</p>
              <div id="scroller-anchor">
                <div id="scroller">
                  <div id="toc"></div>
                </div>
              </div></div>
        </div>
      </div>
    </div>
  </div>
  <div class="footer">
  <div class="container">
    <ul>
      <li><h5>Akka</h5></li>
      <li><a href="http://akka.io/docs">Documentation</a></li>
      <li><a href="http://akka.io/downloads">Downloads</a></li>
    </ul>
    <ul>
      <li><h5>Contribute</h5></li>
      <li><a href="http://github.com/akka/akka">Source Code</a></li>
      <li><a href="http://groups.google.com/group/akka-user">Mailing List</a></li>      
      <li><a href="http://www.assembla.com/spaces/akka/tickets">Report a Bug</a></li>      
    </ul>
    <ul>
      <li><h5>Company</h5></li>
      <li><a href="http://typesafe.com/products/typesafe-subscription">Commercial Support</a></li>
      <li><a href="http://akka.io/team">Team</a></li>
      <li><a href="mailto:info@typesafe.com">Contact</a></li>
    </ul>
    <ul>
      <li><img src="../_static/watermark.png" align="center"/></li>
    </ul>
  </div>
  <div class="container copyright">
    <p style="float: left;">
      © 2012 <a href="http://typesafe.com/">Typesafe Inc.</a> <span class="license">Akka is Open Source and available under the Apache 2 License.</span>
    </p>
    <p style="float: right; font-size: 12px;">
      Last updated: Apr 13, 2012
    </p>          
  </div>
</div>
<script type="text/javascript">
  $('#toc').toc();
</script>
  

  </body>
</html>